package com.example.demo.TakeMaterial.controller;

import com.example.demo.common.ResponseData;
import com.example.demo.entryWarehouse.entity.StoreInform;
import com.example.demo.entryWarehouse.service.StoreInformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/deliveryManagement/store-inform")
@PreAuthorize("hasAnyAuthority('1','2','4','5')")
@CrossOrigin(origins = {"*"})
public class OthersController {
    @Autowired
    StoreInformService storeInformService;

    @GetMapping("/selectAll")
    public ResponseData selectAll() {
        List<StoreInform> storeInformList = storeInformService.list();
        return ResponseData.buildOk(storeInformList.size(), storeInformList);
    }
}
